package com.class05;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/servletB")
public class ServletB extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        http协议下相对路径 ：相对的是当前项目url：协议、域名、端口号、项目名(运用上下文) http://localhost:8080/
//        写法：hello.html ./hello.html

//        绝对路径：必须与 /开头    写法：/hello.html
//        resp.sendRedirect("./hello.html");
        req.getRequestDispatcher("WEB-INF/views/view1.html").forward(req,resp);
    }
}
